<template>
	<view class="" style="background-color: #eee;height: 100vh;box-sizing: border-box;padding: 2rem 1rem;overflow: auto;">
		<view class="tonghi" v-for="(item, index) in indexList" :key="index" >
			<view class="timxians">
			标题：	{{ item.noticeTitle }}
			</view>
			<view class="timxians1">发布人： {{ item.createBy }}</view>
			<view class="timxians2">发布时间：{{ item.createTime }}</view>
			<view class="buttom" @click="handleClick($event, item)">查看</view>
		</view>
		<u-toast ref="uToast"></u-toast>

	</view>
</template>

<script>
	import {
		baseUrl
	} from '../../utils/config.js';
	export default {
		data() {
			return {
				indexList: [],

			}
		},
		onLoad() {
			this.loadmore()
		},
		methods: {
			scrolltolower() {
				this.loadmore()
			},
			loadmore() {
				var thas = this
				uni.request({
					url: `${baseUrl}/wechat/system/listNotice`,
					method: 'GET',
					success(res) {
						thas.indexList = res.data.data
					},

				});

			},
			handleClick(event, item) {
				uni.navigateTo({
					url: `/pages/news/add?id=${item.noticeId}`
				});
			},

		},
	}
</script>

<style scoped lang="scss">
	.tonghi {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		color: #333;
		border-bottom: 1px solid #eee;
		padding: 10px 10px;
		background-color: #fff;
		border-radius: 0.4rem;
		margin-bottom: 2rem;
		border: 1px solid #fff;
		padding: 1rem 1rem;
		position: relative;
	}

	.timxians {
		font-size: 16px;
		font-weight: 600;
		width: 100%;

	}

	.timxians1 {
		font-size: 16px;
		width: 100%;
		
	}

	.timxians2 {
		font-size: 14px;
		width: 100%;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.buttom{
		position: absolute;
		background-color: #2979ff;
		color: #fff;
		border-radius: 0.2rem;
		padding: 5px 10px;
		right: 10px;
		bottom: 10px;
	}
</style>